gjs now provides overrides for GLib's one-shot idle/timeout
functions, so use them to save a bit of code and clearly
indicate that a callback is only invoked once.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3947>
if (this._updatesCheckId)
return;
- this._updatesCheckId = GLib.timeout_add_seconds(
+ this._updatesCheckId = GLib.timeout_add_seconds_once(
GLib.PRIORITY_DEFAULT, 1, () => {
this.notify('n-updates');
delete this._updatesCheckId;
- return GLib.SOURCE_REMOVE;
});
}
});